//
//  SwipeCategoryCollectionViewCell.m
//  YTwallet
//
//  Created by ZhangLin on 2019/3/9.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "SwipeCategoryCollectionViewCell.h"
#import <Masonry.h>
@implementation SwipeCategoryCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupViews];
    }
    return self;
}

-(void)setSelected:(BOOL)selected
{
    [super setSelected:selected];
    if (selected) {
        self.backgroundColor = [UIColor colorWithRed:91 / 255.0 green:113 / 255.0 blue:255 / 255.0 alpha:1];
        self.titleLab.textColor = [UIColor whiteColor];
    }else
    {
        self.backgroundColor = [UIColor colorWithRed:248 / 255.0 green:248 / 255.0 blue:248 / 255.0 alpha:1];
        self.titleLab.textColor = [UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1];
    }
    
}

-(void)setupViews
{
    self.backgroundColor = [UIColor colorWithRed:248 / 255.0 green:248 / 255.0 blue:248 / 255.0 alpha:1];
    self.layer.cornerRadius = 18;
    
    self.titleLab = [[UILabel alloc] init];
    self.titleLab.textColor = [UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1];
    self.titleLab.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.titleLab];
    self.titleLab.textAlignment = NSTextAlignmentCenter;
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.centerY.equalTo(self);
        make.width.equalTo(self);
        make.height.equalTo(self);
    }];
}



@end
